package com.dynamicallo.ty.test;

import java.util.List;

import org.apache.commons.io.FileUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.dynamicallo.ty.entity.Content;
import com.dynamicallo.ty.service.IContentService;
import com.dynamicallo.ty.service.IInterbaleService;

/**
 * 
 * @author wb
 * @date 2016年1月2日 下午9:01:53
 */
@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations="classpath:spring-mybatis.xml")
@ContextConfiguration(locations={"classpath*:spring-mybatis.xml", "classpath*:applicationContext.xml"})
public class test1 {
    @Autowired
    private IContentService contentService;
    @Autowired
    private IInterbaleService intertableService;
    @Test
    public void testGetAllContent(){
        List<Content> contents = contentService.getAllContent();
        for(Content content:contents){
            System.out.println(content);
        }
        
        System.out.println("输出成功");
    }
    @Test
    public void getAllActionByContentId(){
        List<Integer> ls = intertableService.getAllActionByContentId(1);
        for(Integer i :ls){
            System.out.println(i);
        }
    }
    
    
    public static void main(String[] args) {
        ApplicationContext ctx = new FileSystemXmlApplicationContext("classpath:applicationContext.xml"); 
        System.out.println("输出成功");
    }
}

